﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace MPViz
{
    class MPClass
    {
        public string number = "";
        public string name = "";
        public string type = "";
        public List<string> attr = new List<string>();
        public string mod = "";

        public MPClass() { }

        public string toString4Dot()
        {
            StringWriter sw = new StringWriter();

            sw.Write(number);
            sw.Write("[label = \"{");
            sw.Write(name);

            switch (type)
            {
                case "mp":
                    sw.Write("\\n\\<\\<MP\\>\\>");
                    break;
                case "verb":
                    sw.Write("\\n\\<\\<Verb\\>\\>");
                    break;
                case "noun":
                    break;
            }

            // if attribute exists
            if (attr.Count() > 0)
            {
                sw.Write("|");
                foreach (string a in attr)
                {
                    sw.Write(a);
                    sw.Write("\\l");
                }

            }
            sw.WriteLine("}\"]");

            return sw.ToString();
        }
    }
}
